package com.cc8w.service;

import com.cc8w.entity.TeacherPojo;
import com.cc8w.entity.UserPojo;
import com.cc8w.mapper.RoleMapper;
import com.cc8w.mapper.UserMapper;
import com.cc8w.util.ReturnData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("rolesService")
@Transactional
public class RoleService {
	@Autowired
	@Qualifier("roleMapper")
	private RoleMapper roleMapper;


	/**
	 * 通过用户名获得角色
	 */
	public List<String> queryRolesByUserName(String userName) {
		System.out.println("----------"+userName);
		List<String> roles = roleMapper.queryRolesByUserName(userName);
		return roles;
	}

}
